#pragma once


#define NOPARENT 0
#define ABOVERIGHT 1
#define ABOVE 2
#define ABOVELEFT 3
#define RIGHT 4
#define LEFT 5
#define BELOWRIGHT 6
#define BELOW 7
#define BELOWLEFT 8

#include "entities/entity.h"

class TerrainFeature;
class TerrainType;

class Tile:public Entity{
    public:
        Tile(int index);

		int F,G,H;
        int ParentID;
		int ParentDirection;

        virtual EntityType GetType(){ return ET_TILE; }

        int GetImprovementID(){ return improvement; }
        bool HasImprovement(){ if(improvement!=-1){return true;} else{ return false; } }

        float GetRoadMultiplier(){ return 1; }//road->GetMultiplier(); }
        int GetIndex(){ return index; }
		bool DiagonalParent();

		void SetParentDirection(int dir){ ParentDirection=dir; }

        void SetImprovement(int improvement){ this->improvement = improvement; }
        void SetTerrain(std::string terrain = "none", std::string feature = "none");
        std::string GetTerrainType(){ return terrainTypeName; }
        std::string GetFeature(){ return terrainFeatureName; }
        float GetCenterHeight(){ return centerHeight; }

        void ResetPathfinding();

        void SetRoadType(std::string roadType){ this->roadType = roadType; }
        std::string GetRoadType(){ return roadType; }

        void SetMinimumDistanceToFreshWater(float dist);

        float GetDistanceToFreshWater(){ return distanceToFreshWater; }

        void SetHasRiver(bool has){ hasRiver = has; }
        bool HasRiver(){ return hasRiver; }

        int GetFood();

    protected:
        std::string terrainTypeName;
        std::string terrainFeatureName;
        std::string roadType;

        int terrain_food;

        bool hasRiver;

        int improvement;

        float distanceToFreshWater;
        float centerHeight;
        float r, g, b;
        float movementCost;
};
